package cn.com.bdqn.dao;

import cn.com.bdqn.entity.CstActivity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CstActivityDao {

    @Insert("insert into cst_activity values\n" +
            "(default,#{atvCustNo},#{atvDate},#{atvPlace},#{atvTitle},#{atvDesc});")
    public int addCstActivity(CstActivity cstActivity);

    @Delete("delete from cst_activity where atv_id = #{value};")
    public int delCstActivity(Long atvId);

    public int updateCstActivity(CstActivity cstActivity);

    @Select("select * from cst_activity where atv_cust_no = #{value};")
    public List<CstActivity> queryByAtvCustNo(String atvCustNo);

    @Select("select * from cst_activity where atv_id = #{value};")
    public CstActivity queryByAtvId(Long atvId);
}
